package com.jhoncy.rapid.base.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author zhuangqi
 * @date 2017/7/19.
 */
@Entity
public class BasePermission implements Serializable{

    private static final long serialVersionUID = 7941881275339438671L;

    @Id
    @Column(nullable = false,length = 32)
    private String permissionId;

    @Column(length = 32)
    private String parentId;

    @Column(nullable = false,length = 32)
    private String permissionName;

    @Column(length = 128)
    private String url;

    @Column(length = 8)
    private String method;

    private String type;

    @Column(length = 50)
    private String icon;

    @Column(nullable = false)
    private Integer orderNum;

    @Transient
    private List<BasePermission> children = new ArrayList<>();

    public String getPermissionId() {
        return permissionId;
    }

    public void setPermissionId(String permissionId) {
        this.permissionId = permissionId;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public List<BasePermission> getChildren() {
        return children;
    }

    public void setChildren(List<BasePermission> children) {
        this.children = children;
    }
}
